package cn.tedu.oop;

public class Test3_Abstract {
    public static void main(String[] args) {
//        Animal2 a = new Dog2();
        Animal2 a  = new Cat2();
        a.eat();
        a.sleep();
    }
}
abstract class Animal2{
    public void eat(){
        System.out.println("Animal..eat()");
    }
    abstract public void sleep();
}
abstract class Dog2 extends Animal2{

}
class Cat2 extends Animal2{

    @Override
    public void sleep() {
        System.out.println("猫吃鱼");
    }
}